﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.BLL;

public partial class news_mini_TrainManage : System.Web.UI.Page
{
    public string tables = "";
    public string pages = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TrainBLL tdal = new TrainBLL();
            int pageindex = 1;
            DateTime begintime = DateTime.Parse("2011-01-01");
            DateTime endtime = DateTime.Today.AddYears(500);
            string title = "";
            string type = "ZXHC";

            if (Request["index"] != null && Request["index"].ToString()!="")
                pageindex = Convert.ToInt32(Request["index"].ToString());
            if (Request["begin"] != null && Request["begin"].ToString() != "")
                begintime = Convert.ToDateTime(Request["begin"].ToString());
            if (Request["end"] != null && Request["end"].ToString() != "")
                endtime = Convert.ToDateTime(Request["end"].ToString());
            if (Request["title"] != null && Request["title"].ToString() != "")
                title = Request["title"].ToString();
            //if (Request["type"] != null && Request["type"].ToString() != "")
            //    type = Request["type"].ToString();

            tables = tdal.GetTrainList(pageindex, begintime, endtime, title, type);
            pages = tdal.CountPage(pageindex, begintime, endtime, title, type);
            
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Response.Redirect("TrainDetail.aspx", false);
    }
}